package ca.etsmtl.log660.configuration;

import java.io.File;
import java.net.URL;
import java.util.Properties;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

public class SessionFactoryHelper {

	private static final SessionFactory sessionFactory;

	static {
		try {

			Configuration cfg = new Configuration();//.addFile("hibernate.cfg.xml");
		
			sessionFactory = cfg.configure().buildSessionFactory();
		} catch (Throwable e) {
			System.err.println("Could not create the session factory.");
			throw new ExceptionInInitializerError(e);
		}

	}

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}
}
